﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TireService.Web.Reports.View
{
    public partial class ServiceCarScheduleReportView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["ContainerId"] != null)
                {
                    int containerid = Convert.ToInt32(Request.QueryString["ContainerId"]);
                    DateTime scheduledate = Convert.ToDateTime(Request.QueryString["ScheduleDate"]);

                    // Load report with multiple schedules
                    this.ReportViewer1.Report = new Reports.Design.ServiceCarSchedules(scheduledate, containerid);
                }
                else
                {
                    int servicecarid = Convert.ToInt32(Request.QueryString["ServiceCarId"]);
                    DateTime scheduledate = Convert.ToDateTime(Request.QueryString["ScheduleDate"]);

                    // Load report with single schedule
                    //this.ReportViewer1.Report = new Reports.Design.ServiceCarSchedule(servicecarid, scheduledate);
                    this.ReportViewer1.Report = new Reports.Design.ServiceCarSchedules(scheduledate, servicecarid, true);
                }
            }
            catch (Exception)
            {


            }
        }
    }
}